package api.ejb;
import java.rmi.Remote;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

import messageObjects.BalanceObj;
import messageObjects.LotteryGameObj;

import p3_entities.Friend;
import p3_entities.Lindenmovement;
import p3_entities.Usermessage;
import p3_entities.Userprofile;

import api.InvalidAuthenticationException;
import api.PhasebookToken;
import api.UserProfileTypes.Gender;
import api.UserProfileTypes.NotificationApproach;
import api.ejb.IWallet.MovementsType;


@WebService
@SOAPBinding(style = Style.RPC)
public interface IFacade extends Remote{

	boolean registerUser(String username, String password) 
	throws InvalidAuthenticationException;

	PhasebookToken authenticate(String username, String password) 
	throws InvalidAuthenticationException;

	Date getLastLogin(PhasebookToken token, String username) 
	throws InvalidAuthenticationException;

	boolean resetPassword(PhasebookToken token, String username)
	throws InvalidAuthenticationException;

	boolean validateAuthenticationToken(PhasebookToken token)
	throws InvalidAuthenticationException;

	List<String> searchFriends(PhasebookToken token, String searchString) 
	throws InvalidAuthenticationException;

	boolean sendFriendshipInvitation(PhasebookToken token, int fromId, int toId)
	throws InvalidAuthenticationException;

	List<Friend> getPendingFriendshipRequests(PhasebookToken token)
	throws InvalidAuthenticationException;

	boolean confirmFriendshipRequest(PhasebookToken token, int requesterdId)
	throws InvalidAuthenticationException;

	boolean isFriendWith(PhasebookToken token, int baseId, int friendId)
	throws InvalidAuthenticationException;

	List<Userprofile> getMyFriends(PhasebookToken token)
	throws InvalidAuthenticationException;

	boolean updateName(PhasebookToken token, String name)
	throws InvalidAuthenticationException;

	boolean updateAge(PhasebookToken token,int age)
	throws InvalidAuthenticationException;

	boolean updateCity(PhasebookToken token,String city)
	throws InvalidAuthenticationException;

	boolean updateGender(PhasebookToken token,Gender sex)
	throws InvalidAuthenticationException;

	boolean updateEmail(PhasebookToken token,String email)
	throws InvalidAuthenticationException;

	boolean updateNotificationApproach(PhasebookToken token,NotificationApproach approach, boolean flag)
	throws InvalidAuthenticationException;

	Userprofile getProfileById(PhasebookToken token)
	throws InvalidAuthenticationException;

	Userprofile getProfileByUsername(PhasebookToken token, String username) 
	throws InvalidAuthenticationException;

	boolean updatePhoto(PhasebookToken token, int photoId)
	throws InvalidAuthenticationException;

	String getEMailById(PhasebookToken token)
	throws InvalidAuthenticationException;

	boolean registerBet(PhasebookToken token, int choice, int amount, int gameId) 
	throws InvalidAuthenticationException;

	LotteryGameObj getActiveLotteryDetails(PhasebookToken token) 
	throws InvalidAuthenticationException ;	

	boolean publishPublicMessage(PhasebookToken token, int ownerId, int posterId, String message, int photoId)
	throws InvalidAuthenticationException;

	boolean publishPrivateMessage(PhasebookToken token, int ownerId, int posterId, String message, int photoId)
	throws InvalidAuthenticationException;

	List<Usermessage> getPublicMessageList(PhasebookToken token)
	throws InvalidAuthenticationException;

	List<Usermessage> getPrivateMessageList(PhasebookToken token)
	throws InvalidAuthenticationException;

	int addPhoto(PhasebookToken token, String photoPath)
	throws InvalidAuthenticationException;

	boolean reloadLinden(PhasebookToken token, int amount, MovementsType type);

	

	BalanceObj getUserBalance(PhasebookToken token);

	Userprofile getLoggedProfile(PhasebookToken token) 
	throws InvalidAuthenticationException;
}
